import java.text.SimpleDateFormat;
import java.util.Date;


public class PeopleAction implements java.io.Serializable {


    private Integer id;
    private String cno;
    private String sno;
    private String dno;
    private int initrice;
    private int restrice;
    private int score;
    private Date time;

   public PeopleAction() {
   }

   public PeopleAction(String cno, String sno, String dno, int initrice, int restrice, int score, Date time) {
      this.cno = cno;
      this.sno = sno;
      this.dno = dno;
      this.initrice = initrice;
      this.restrice = restrice;
      this.score = score;
      this.time = time;
   }
  
   public Integer getId() {
       return this.id;
   }
   
   public void setId(Integer id) {
       this.id = id;
   }

   public int getInitrice() {
       return this.initrice;
   }
   
   public void setInitrice(int initrice) {
       this.initrice = initrice;
   }
   public int getRestrice() {
       return this.restrice;
   }
   
   public void setRestrice(int restrice) {
       this.restrice = restrice;
   }
   public int getScore() {
       return this.score;
   }
   
   public void setScore(int score) {
       this.score = score;
   }
   public Date getTime() {
       return this.time;
   }
   public void setTime(Date time) {
	   this.time=time;
   }
   public String getFormatTime(){
       SimpleDateFormat myFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
       return myFormat.format(this.time);
   }
   public int getLunchAppetite(){
       SimpleDateFormat HourFormat = new SimpleDateFormat("H");
       int hour=Integer.parseInt(HourFormat.format(this.time));
	   if(11<=hour && 13>=hour) return this.initrice-this.restrice;
	   else return -1;
   }
   public int getMinute(){
       SimpleDateFormat HourFormat = new SimpleDateFormat("H");
       SimpleDateFormat MinuteFormat = new SimpleDateFormat("m");
       int hour=Integer.parseInt(HourFormat.format(this.time));
       int minute=Integer.parseInt(MinuteFormat.format(this.time));
       return hour*60+minute;
   }
   public int getDinnerAppetite(){
       SimpleDateFormat HourFormat = new SimpleDateFormat("H");
       int hour=Integer.parseInt(HourFormat.format(this.time));
	   if(17<=hour && 21>=hour) return this.initrice-this.restrice;
	   else return -1;
   }
public String getCno() {
	return cno;
}

public void setCno(String cno) {
	this.cno = cno;
}

public String getSno() {
	return sno;
}

public void setSno(String sno) {
	this.sno = sno;
}

public String getDno() {
	return dno;
}

public void setDno(String dno) {
	this.dno = dno;
}
}
